<?php

namespace aerovuelos\FrontBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class BuscarVuelosType extends AbstractType {

    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
                ->add('fechaSalida')
                ->add('origen', 'text', array(
                    'required' => false,
                    'mapped' => false,
                    'attr' => array('class' => 'origen')
                ))
                ->add('destino', 'text', array(
                    'required' => false,
                    'mapped' => false,
                    'attr' => array('class' => 'destino')
                ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'aerovuelos\VueloBundle\Entity\Vuelos'
        ));
    }

    public function getName() {
        return 'front_vuelostype';
    }

}
